import React,{useEffect,useState} from 'react'
import styles from './index.less'
 type componentType ={
    index?:number
    onDoubleClick?:Function
    style?:React.CSSProperties 
}
const RankList: React.FC<componentType> =({index = -2,onDoubleClick=()=>{},style={}})=> {
  const [clickedLast, setClickedLast] = useState<number>(-1)
    return (
        <div className={styles['list']}
        style={
            clickedLast === index 
            ? { ...style,backgroundColor: 'rgb(229,229,229)' } 
            : {...style}
        }
        onDoubleClick={()=>onDoubleClick()}
            onClick={() => {
              setClickedLast(index)
            }}>
        
        </div>
        )
}
export default RankList